import Vue from 'vue'
import VueRouter from 'vue-router'
//import { omponent} from 'vue/types/umd'
import HomeView from '../views/HomeView.vue'
import 'vant/lib/index.css'
import { Popup } from 'vant';
Vue.use(Popup);
Vue.use(VueRouter)

const routes = [
  {
    //首页
    path: '/home',
    name: 'home',
    component: HomeView,
    meta:{
      show:true
    }
  },
  {
    path: '/',
    redirect: '/home',
    meta:{
      show:true
    }
  },
  {
    path: '/searchview',
    name: 'searchview',
    component: () => import('../views/search/SearchView.vue')
  },
  {
    path:"/cart",
    component:()=>import('../views/Cart.vue'),meta:{
      // show:true
    }
  },
  {
    path:"/classify",
    component:()=>import('../views/class/Classify.vue'),meta:{
      show:true
    },
    children:[
      {
        path:'message',
        component:()=>import('../views/class/Message.vue'),meta:{
          show:true
        },
     },
      {
          path:'news',
          component:()=>import('../views/class/News.vue'),meta:{
            show:true,
          },
      },
   ]
  },
  {
    path:"/usercenter",
    component:()=>import('../views/UserCenter.vue'),meta:{
      show:true,
    }
    
  },
  {
    path:"/detail",
    name:"detail",
    component:()=>import('../views/home/Detail.vue')
  },
  {
    path:"/search",
    name:"search",
    component:()=>import('../views/search/Search.vue')
  },
  {
    path:"/land",
    name:"land",
    component:()=>import('../views/home/Land.vue')
  },
  {
    path:"/register",
    name:"register",
    component:()=>import('../views/home/Register.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
